<template>
  <div class="python">
    python数据可视化

    <div class="content">
      <!-- <img :src="url" alt="" style="width: 100px; height: 100px" v-if="url" /> -->
      <el-image
        style="width: 100%; height: 100%"
        :src="url"
        :preview-src-list="srcList"
      >
      </el-image>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { useStore } from "@/store"
import { ref } from "vue"
const store = useStore()
console.log("数据")

store.dispatch("moduleSpider/spiderTest")
// const ws = new WebSocket("ws://localhost:8888")
// ws.onopen = (ev) => {
//   console.log("连接成功", ev)
// }

const url = ref(
  // "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
  ""
)
const srcList = ref([
  "https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg",
  "https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg"
])

// ws.onmessage = (msg) => {
//   console.log("msg", msg)
//   url.value = msg.data
// }
</script>

<style lang="less">
.python {
  width: 100%;
  height: 100%;
  .content {
    width: 100%;
    height: 90%;
  }
}
</style>
